<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<link rel="stylesheet" href="static/css/bootstrap.min.css" />
	<link rel = "stylesheet" href = "static/css/globle.css"/>
	<script type="text/javascript" src = "static/js/jquery.js"/></script>
	<title></title>
	
</head>
<body>
	<div class="container">
		<div class="row">
			
			<div class="span12" >
				<h1 style = "margin-top:80px">欢迎使用PMS</h1>
				<hr />
				<span>${sessionScope.meg}</span>
				<c:remove var="meg" scope = "session"/>
				<c:choose>
					
					<c:when test="${param.code == '001' }">
						<span>输入的用户名或密码错误</span>
					</c:when>
				
				</c:choose>
				<form action="login.jspx" method = "post" id = "myform">
					<h3>账号 </h3>
					<input type="text" name = "name" autocomplete = "off"/>
					<span id = "name-error"></span>
						<h3>密码 </h3>
					<input type="password" name = "password" />
					<span id = "password-error"></span><br />
					<input class = "btn btn-primary" type="button" id = "btn" value = "进入系统"/>
				</form>
			</div>
			
		</div>
		
	</div>
	<script type="text/javascript">
		$(document).ready(function(){
			$("input[name = 'name']").keydown(function(){
					$("#name-error").html("");
			});
			$("input[name = 'password']").keydown(function(){
				$("#password-error").html("");
			});
			
			$("#btn").click(function(){
				
				var name = $("input[name = 'name']").val();
				var password = $("input[name ='password']").val();
				if(name.trim() == ""){
					$("#name-error").html("请输入账号");
					$("input[name ='name']").focus();
					return;
				}
				if(password == ""){
					$("#password-error").html("请输入密码");
					$("input[name ='password']").focus();
					return;
				}
				
				
				
				$("#myform").submit();
			})
			
			
		})
	</script>
</body>
</html>